﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ActivityChoose.ascx.cs" Inherits="Controls_Activity_ActivityChoose" %>
<asp:Panel ID="Panel1" runat="server" Style="display:inherit;" CssClass="modalPopup" Width="400px">
    <asp:Panel ID="Panel2" runat="server" CssClass="modalPopupHeader">
        <div>&nbsp;&nbsp;&nbsp;<asp:Literal ID="literalModalPopup" runat="server"></asp:Literal></div>
    </asp:Panel>
        <div style="padding:2px; height:215px;">
            <asp:GridView ID="gridView" runat="server" AutoGenerateColumns="False" OnRowDataBound="gridView_RowDataBound">
            <Columns>
                <asp:TemplateField HeaderText="选择" >
                    <ItemTemplate>
                        <input id="CategoryID" name="CategoryID" type="radio" value='<%#DataBinder.Eval(Container.DataItem,"CategoryID")%>'  />
                        <asp:HiddenField ID="HiddenField1" Value='<%#DataBinder.Eval(Container.DataItem,"Description")%>' runat="server" />
                    </ItemTemplate>
                    <HeaderStyle Width="40px" />
                </asp:TemplateField>
			    <asp:BoundField DataField="GroupCodeName" HeaderText="类别" />		
			    <asp:HyperLinkField DataTextField="Subject" HeaderText="名称" />
            </Columns>
        </asp:GridView>
        </div>
        <div class="modalPopupFooter">
             <asp:LinkButton id="btnModalPopupOK" 
                 runat="server" onclick="btnModalPopupOK_Click">确定</asp:LinkButton>
                
             <a id="btnModalPopupCancel" href="#" 
                onclick="return false;" >取消</a>
             <p style="display:none"><ofcc:LinkButton ID="btnModalPopupNone" 
                runat="server" >None Event</ofcc:LinkButton></p>
        </div>
</asp:Panel>
<ajax:ModalPopupExtender runat="server" ID="modalPopup"    
    PopupControlID="Panel1" 
    PopupDragHandleControlID="Panel2"
    TargetControlID="btnModalPopupNone"
    BackgroundCssClass="modalBackground"
    BehaviorID="modalPopupBehavior" 
    DropShadow="True"
    >    
</ajax:ModalPopupExtender>
<script type="text/javascript">
    function pageLoad() {
        $addHandler($get("btnModalPopupCancel"), 'click', modalPopupHide);
        
        var modalPopupBehavior = $find('modalPopupBehavior');
        modalPopupBehavior.show();
    }

    function modalPopupHide(ev) {
        //fix firefox
        if ($get('<%=Panel1.ClientID %>') != null)
            $get('<%=Panel1.ClientID %>').style.display = "none";

        if ($get('<%=Panel1.ClientID %>_DropShadow') != null)
            $get('<%=Panel1.ClientID %>_DropShadow').style.display = "none";

        if ($get('<%=Panel1.ClientID %>__progressDisplay') != null)
            $get('<%=Panel1.ClientID %>__progressDisplay').style.display = "none";

        var divList = $$('div.modalBackground');
        divList[0].style.display = "none";
        
        if (ev.type == "click") ev.preventDefault();        
        var modalPopupBehavior = $find('modalPopupBehavior');
        modalPopupBehavior.hide();
    }
</script>